package main

import "fmt"

func main() {
	var c Cat = Cat{}
	c.test3()
	c.test2()
	c.test1()

	var c1 A = Cat{}
	c1.test1()
	fmt.Println(c1)

	var c2 B = Cat{}
	c2.test2()

	var c3 C = Cat{}
	c3.test3()
	c3.test1()
	c3.test2()
}

type A interface {
	test1()
}

type B interface {
	test2()
}

type C interface {
	A
	B
	test3()
}

type Cat struct {
	name string
}

func (c Cat) test1() {
	fmt.Println("test1")
	c.name = "ylf"
}

func (c Cat) test2() {
	fmt.Println("test2")
}

func (c Cat) test3() {
	fmt.Println("test3")
}
